# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>

pkgname=libnsgif
pkgver=0.2.1
pkgrel=8
pkgdesc='Decoding library for the GIF image file format'
arch=(loong64 x86_64)
url='https://www.netsurf-browser.org/projects/libnsgif/'
license=(MIT)
makedepends=('netsurf-buildsystem>=1.9')
source=("https://download.netsurf-browser.org/libs/releases/$pkgname-$pkgver-src.tar.gz")
b2sums=('ccebd1830db1caa016ebc0c1f2c421523963df16e38cdf85c5300d2a9a325dc9c52c89c79ccbddbc315535a20607458bbfedcde8df02b5e2977d383cd6603220')

build() {
  CFLAGS+=' -ffat-lto-objects -fno-strict-aliasing -w'
  make -C $pkgname-$pkgver \
    COMPONENT_TYPE=lib-shared \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr
}

package() {
  make -C $pkgname-$pkgver \
    COMPONENT_TYPE=lib-shared \
    DESTDIR="$pkgdir" \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr \
    install
  install -Dm644 $pkgname-$pkgver/COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
